import requests
import json

payload = {
    "text": "胖子",
    "keyword_top_k": 5,
    "keyword_cloud_n": 200,
    "keyword_allow_pos": ["n", "vn", "ns", "nr", "eng"]
}


r = requests.post('http://127.0.0.1:10000/keywordcloud', json=payload, timeout=200)
a = r.json()
a = a['result']['word2vec']
print("2\n")
# print(a)
print(json.dumps(a, indent=4, sort_keys=True, ensure_ascii=False))


payload = {
    "keywords": ["低"],

}


r = requests.post('http://127.0.0.1:10000/classify', json=payload, timeout=200)
a = r.json()
print("2\n")
print(a)
# print(json.dumps(a, indent=4, sort_keys=True, ensure_ascii=False))




# r = requests.post('http://139.196.112.61:10000/keyword', json=payload, timeout=200)
# a = r.json()
#
# print("2\n")
# # print(a)
# print(json.dumps(a, indent=4, sort_keys=True, ensure_ascii=False))


payload = {
    "text": "幸福的阿皮",

}

r = requests.post('http://127.0.0.1:10000/seg', json=payload, timeout=200)
a = r.json()
print("2\n")
print(a)
# print(json.dumps(a, indent=4, sort_keys=True, ensure_ascii=False))

